import Vue from 'vue'
import Router from 'vue-router'
import Container from '@/components/Container'
import Login from '@/components/Login'
import Error from '@/components/Error'
import Search from '@/components/searchs/Search'
import SearchMain from '@/components/searchs/SearchMain'
import Triages from '@/components/Triages'
import Statistic from '@/components/statistics/Statistic'
import StatisticMain from '@/components/statistics/StatisticMain'
import PatientInfo from '@/components/statistics/PatientInfo'
import Diagnosis from '@/components/statistics/Diagnosis'
import Rescue from '@/components/statistics/Rescue'
import Departments from '@/components/statistics/Departments'
import ChestPain from '@/components/statistics/ChestPain'
import Coronary from '@/components/statistics/Coronary'
import Trauma from '@/components/statistics/Trauma'
import Read from '@/components/Read'
import Declare from '@/components/Declare'
import Protect from '@/components/Protect'
import About from '@/components/About'
import Help from '@/components/Help'
import Sugesstion from '@/components/Sugesstion'
import CaseDetail from '@/components/CaseDetail'
import ListDisposal from '@/components/test/ListDisposal'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Container',
      component: Container,
      meta: {requiresAuth: true}
    },{
    	path: '/login',
    	name: 'Login',
    	component: Login,
    	meta: {requiresAuth: false}
    },{
      path: '/search',
      component: Search,
      children:[{
        path:"",
        component:SearchMain,
        meta: {requiresAuth: true}
      }],
      meta: {requiresAuth: true}
    },{
      path: '/triages',
      name: 'Triages',
      component: Triages,
      meta: {requiresAuth: true}
    },{
      path: '/statistic',
      component: Statistic,
      children:[{
        path:"",
        component:StatisticMain,
        meta: {requiresAuth: true}
      },{
        path:"rescue",
        component:Rescue,
        meta: {requiresAuth: true}
      },{
        path:"patientInfo",
        component:PatientInfo,
        meta: {requiresAuth: true}
      },{
        path:"diagnosis",
        component:Diagnosis,
        meta: {requiresAuth: true}
      },{
        path:"departments",
        component:Departments,
        meta: {requiresAuth: true}
      },{
        path:"chestPain",
        component:ChestPain,
        meta: {requiresAuth: true}
      },{
        path:"coronary",
        component:Coronary,
        meta: {requiresAuth: true}
      },{
        path:"trauma",
        component:Trauma,
        meta:{requiresAuth:true}
      }],
      meta: {requiresAuth: true}
    },{
      path: '/duty',
      component: Read,
      children:[{
        path:"",
        component:Declare
      },{
        path:"protect",
        component:Protect
      }]
    },{
      path: '/about',
      component: About,
      children:[{
        path:"help",
        component:Help,
        meta: {requiresAuth: true}
      },{
        path:"sugesstion",
        component:Sugesstion,
        meta: {requiresAuth: true}
      }],
      meta: {requiresAuth: true}
    },{
      path: '/caseDetail/:recordUUID',
      name: 'CaseDetail',
      component: CaseDetail,
      meta: {requiresAuth: true}
    },{
      path: '/listDisposal',
      name: 'listDisposal',
      component: ListDisposal,
      meta: {requiresAuth: false}
    },{
      path: '*',
      name: 'error',
      component: Error,
      meta: {requiresAuth: false}
    }
  ]
})
